<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>添加订单</title>
    <!--    bootstrap美化界面-->
    <link th:href="@{/css/bootstrap.css}" rel="stylesheet">
    <script th:src="@{/js/bootstrap.js}" rel="stylesheet"></script>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f8f9fa;
            margin: 20px;
        }

        .container {
            margin-top: 20px;
        }

        .page-header h1 {
            margin-top: 20px;
        }

        form {
            margin-top: 20px;
        }

        label {
            font-weight: bold;
            margin-top: 10px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        input[type='submit'] {
            background-color: #007bff;
            color: white;
            border: none;
            padding: 10px 20px;
            cursor: pointer;
        }

        input[type='submit']:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>添加订单</h1>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12 text-right">
            <a class="btn btn-primary" th:href="@{/allProduct}">返回</a>
        </div>
    </div>

    <form method="post" th:action="@{/insertOrder}" class="col-md-6">
        <div class="form-group">
            <label>用户id：</label>
            <input type="text" name="user_id" class="form-control" th:value="${user_id}" required="required" readonly="readonly">
        </div>
        <div class="form-group">
            <label>下单时间：</label>
            <input type="text" class="form-control" name="order_date" id="time"
                   th:value="${#dates.format(#dates.createNow(), 'yyyy-MM-dd HH:mm:ss')}" required="required" readonly="readonly">
        </div>
        <input type="hidden" name="status" th:value="已下单">
        <div class="form-group">
            <label>姓名：</label>
            <input type="text" name="name" class="form-control" required="required">
        </div>
        <div class="form-group">
            <label>电话：</label>
            <input type="text" name="phone_number" class="form-control" required="required">
        </div>
        <div class="form-group">
            <label>地址：</label>
            <input type="text" name="address" class="form-control" required="required">
        </div>
        <div class="form-group">
            <label>商品编号：</label>
            <input type="text" name="product_id" class="form-control" th:value="${product.product_id}"
                   required="required" readonly="readonly">
        </div>
        <div class="form-group">
            <label>数量：</label>
            <input type="text" name="quantity" class="form-control" required="required">
        </div>
        <div class="form-group">
            <input type="submit" value="添加订单" class="form-control">
        </div>
    </form>
</div>

</body>
</html>